

//显示操作按钮
function displayButtons(status){
	if(status == null){
		//case: 新增
		enableIconBtn("save");
		disableIconBtn("delete");
	}else{
		//case:编辑
		enableIconBtn("save");
		enableIconBtn("delete");
	}
	
}	 


//保存
function saveAppAdmin(){
	if(!validateAppAdmin($('appAdmin'))){
    	return;
    }
    var postData="";
    postData += $j('#appAdmin :input').serialize();
    var url=$j('#appAdmin').attr('action')+"?doAction=save";
    $j.post(url,postData,saveAppAdminCallback,"json");
}
//保存回调函数
function saveAppAdminCallback(data){
	if(data.error){
		sysMsg(data.error,true);
		return;
	}
	if(data.appAdminId){
		$j("#appAdminId").val(data.appAdminId);
	}
	
	refreshParent();
	returnToList();
	sysMsg(__FMT.appAdminDetail_saveAppAdmin_success);
}


// 删除
function deleteAppAdmin(){
	if (confirm(__FMT.common_message_confirmDeleteThis + "?")) {
		var paraData = {
			appAdminId: $j("#appAdminId").val()
		};
		$j.post(__ctxPath + "/system/appAdmin/blank.html?doAction=delete", paraData, deleteAppAdminCallback,"json");
	}
}
//删除回调函数
function deleteAppAdminCallback(data){
	sysMsg(data.msg);
	refreshParent();
	returnToList();
}

//从Form返回到list
function returnToList(){
	$j('#formDiv').hide();
	$j('#mainDiv').show();
}


//刷新父窗口的产品列表
function refreshParent(){
	refreshAppAdminList();
}
